package com.ktgj.flight.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.jms.core.JmsMessagingTemplate;
import org.springframework.stereotype.Component;

import javax.jms.Destination;

@Component
public class TicketProducter {

    @Autowired
    private JmsMessagingTemplate jmsTemplate;

    public void sendMessage(String destination, final String message) {
        jmsTemplate.convertAndSend(destination, message);
    }


    @JmsListener(destination = "YeePayTicketQueueReturn")
    public void YeePayReceivingMsg(String content){
        System.out.println("生产者接收到消息" +  content);
    }

    @JmsListener(destination = "HuifuTicketQueueReturn")
    public void HuifuReceivingMsg(String content){
        System.out.println("生产者接收到消息" +  content);
    }
}
